<script>on mouseUppush cardgo cd "Ready"wait 20 ticksgo cd "Set"wait 20 tickslock screengo cd "Go"get doTimer(15, "Tom Schoenemann", 1711)visual dissolvepop cardif item 1 of it is not a number thenanswer itelseif item 2 of it = "Button"then put "click the mouse at" && item 3 of it & comma & item 4 of it into anselse if item 2 of it = "Space"then put "press the Space bar" into anselse put "press the" && item 2 of it && "key" into ansanswer "You took" && item 1 of it && "milliseconds to" && ans &"."end ifend mouseUp</script>
<text>This XFCN allows you to do millisecond timing under Hypercard once you pay the Shareware fee of $10. Until then it is limited to 15 millisecond resolution which is only slightly better than ticks (1 tick = 1/60 sec = 16 ms).The usage is as simple as I can get. You must lock the screen and then display the image that you want to appear (by going to a card or showing fields & buttons). Then you call doTimer with the timer resolution that you desire. You are limited to 15 milliseconds (expressed as 15) as the smallest interval without the secret information I will send you when you pay. The XFCN will send an unlock screen message to Hypercard and then start the timer on the next screen refresh. As soon as the subject presses a key or clicks the mouse, the timer will stop and return the time and a string describing the key pressed.Click the button below for an example.</text>
</content>
<name></name>
<script>on returnKeyif not visible of msg then send mouseUp to btn "Example"else pass returnKeyend returnKey</script>
</card>
card_8175.xml
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
<script>on mouseUpanswer "Print the registration form?" with "Cancel" or "To Disk" or "Print"if it = "To Disk" thenask file "Save as:" with "Registration Form"if it = "" then exit mouseUpopen file itwrite cd fld "Registration" to file itclose file itelse if it = "Print" thenprint cd field "Registration"end ifend mouseUpon mouseEnterset hilite of me to trueset hilite of me to falsepass mouseEnterend mouseEnteron mouseWithinset hilite of me to trueset hilite of me to falsepass mouseWithinend mouseWithin</script>
</part>
<part>
<id>8</id>
<type>field</type>
<visible> <false /> </visible>
<dontWrap> <false /> </dontWrap>
<dontSearch> <false /> </dontSearch>
<sharedText> <false /> </sharedText>
<fixedLineHeight> <true /> </fixedLineHeight>
<autoTab> <false /> </autoTab>
<lockText> <false /> </lockText>
<rect>
<left>0</left>
<top>0</top>
<right>512</right>
<bottom>342</bottom>
</rect>
<style>scrolling</style>
<autoSelect> <false /> </autoSelect>
<showLines> <false /> </showLines>
<wideMargins> <false /> </wideMargins>
<multipleLines> <false /> </multipleLines>
<reservedFamily> 0 </reservedFamily>
<titleWidth>0</titleWidth>
<icon>0</icon>
<textAlign>left</textAlign>
<font>Times</font>
<textSize>12</textSize>
<textStyle>plain</textStyle>
<textHeight>24</textHeight>
<name>Registration</name>
<script></script>
</part>
<content>
<layer>card</layer>
<id>1</id>
<text> This XCMD has a secret.Until you pay it is restricted to a resolution of 15 milliseconds. In return for your Shareware payment of $10 you will receive the secret to removing the 15 millisecond limitation and unleashing the capability of up to 1 ms resolution. The secret is a pair of passwords you simply enter as parameters. You send me the money, I send you the passwords. Promptness guarenteed. I also provide support over the net, telephone, mail and in person.</text>
<text>Jon Pugh20525 Mariani Ave. MS: 37ASCupertino, CA 95014</text>
</content>
<content>
<layer>card</layer>
<id>8</id>
<text><span class="style1"></span><span class="style3">doTimer Registration</span><span class="style1">Send $10 US cash, check, or money order to:Jon Pugh20525 Mariani Ave. MS 37ACupertino, CA 95014In return I will send you, via the prefered method listed below </span><span class="style4">and</span><span class="style1"> a letter, a secret code you can use to unlock the doTimer external so that it will allow 1 millisecond timing. I guarentee prompt service and guarentee your satisfaction.Name __________________________________________________________________Address ________________________________________________________________City, State, Zip __________________________________________________________Phone __________________________________________________________________email __________________________________________________________________fax _____________________________________________________________________prefered ________________________________________________________________Comments:</span></text>
</content>
<name>Shareware</name>
<script></script>
</card>
card_14420.xml
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
<text>There is an added bonus. If you pay the shareware fee you will get another feature, in the form of another parameter, which will allow the function to timeout after a specified number of milliseconds. You can only use this option if you pay your shareware fee though.Thus, the full syntax of this external is: doTimer(time [, password1, password2 [, timeout] ]) • time is the resolution of the external in milliseconds (limited to 15 ms before paying and 1 ms afterwards) • password1 and password2 are optional and supplied by me • timeout is the optional maximum time to wait in milliseconds (this cannot be used without the passwords)</text>
</content>
<name></name>
<script></script>
</card>
card_12103.xml
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
<text> This XFCN works by installing 2 asynchronous interrupt routines in the Macintosh OS queues. One is on the VBL queue for the screen with the Hypercard window on it, and one is with the Macintosh OS millisecond time manager. The timer routine just counts, in the increments specified as a parameter. It is started first. The VBL task is then started and it resets the timer every time a VBL occurs. Thus the timer counts up to 16 or so, depending on your monitor, and is then set back to 0 by the VBL task. We now have this aborted-takeoff process going on (but not for long) so we call the Hypercard callback SendHCMessage("set lockScreen to false") and stop the VBL task as soon as it returns. This time the VBL task does not reset the timer, which has been going since the last VBL when HC redrew the screen with the image to be used as stimulus. I then poll GetKeys and Button until they change and kill the timer task. Now I have the time since the image appeared. I simply build the result message based on GetKeys and Button and return.</text>
</content>
<name></name>
<script></script>
</card>
card_10082.xml
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
<text><span class="style1">he Apple Desktop Bus (ADB) used on the Macintosh SE and Macintosh II series of computers (essentially all Macs except for the Mac Plus) has an indeterminate five millsecond delay from the moment a key or the mouse is pressed to the time that is noticed by the computer. This delay is variable and unaccountable. As the engineers keep reminding us, the Macintosh is </span><span class="style5">not</span><span class="style1"> a real time system. This XFCN does nothing to attempt to resolve this discrepancy. This should make the MacPlus the desired platform.</span><span class="style2">If you use ADB your results from this XCMD should take into account this delay as an error which you should acknowledge in your experimental results.</span><span class="style1">There is no known way to account for or measure this delay.</span></text>
</content>
<name></name>
<script></script>
</card>
card_13310.xml
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
<text>This will use the System 7 extended Time Manager drift-free clock, which will account for the time taken by the counting task. Since we use a small task and only a few hundred calls, this really isnΓÇÖt significant to the data at all unless you wait a long time.This external is based on interrupts,which means that when interrupts are off, as they often are on the Macintosh, this external will not be completely accurate. Two noteworthy causes of interrupt latency are the floppy disk drivers and Appletalk, so turn off Appletalk and donΓÇÖt use floppies for the most accurate results.The best platform seems to be a 4MB MacPlus running System 7 with Appletalk off because it does not have the ADB delay. Run Hypercard and your stack off a RAM disk to be really fast and cool.</text>
</content>
<name></name>
<script></script>
</card>
card_7564.xml
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
<text>On color systems (which can have more than one monitor) this XFCN uses the ΓÇÿscrnΓÇÖ resource to identify the monitor that HypercardΓÇÖs window is on.This resource is written to the System file by the Monitors Control Panel whenever your setup is changed. The message ΓÇ£Changes wonΓÇÖt take effect until restartΓÇ¥ will appear whenever this resource has been written. You can make this happen simply by moving any of the pictures in the control panel.If the ΓÇÿscrnΓÇÖ resource is invalid, then this XFCN may not function or give accurate results. You should make sure that it is valid.</text>
</content>
<name></name>
<script></script>
</card>
card_12747.xml
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
<script>on mouseUpanswer file "Where is the stack to install in?" of type stackif it = "" then exit mouseUpset cursor to watchput value of last word of long name of this stack into fromFilerescopy fromFile, it, "XFCN", "doTimer"if the result Γëá "" thenput the resultexit mouseUpend ifend mouseUp</script>
</part>
<part>
<id>5</id>
<type>button</type>
<visible> <true /> </visible>
<reserved5> 0 </reserved5>
<reserved4> 0 </reserved4>
<reserved3> 0 </reserved3>
<reserved2> 0 </reserved2>
<reserved1> 0 </reserved1>
<enabled> <true /> </enabled>
<rect>
<left>138</left>
<top>260</top>
<right>385</right>
<bottom>284</bottom>
</rect>
<style>shadow</style>
<showName> <true /> </showName>
<highlight> <false /> </highlight>
<autoHighlight> <true /> </autoHighlight>
<sharedHighlight> <true /> </sharedHighlight>
<family>0</family>
<titleWidth>0</titleWidth>
<icon>0</icon>
<textAlign>center</textAlign>
<font>Chicago</font>
<textSize>12</textSize>
<textStyle>plain</textStyle>
<name>IΓÇÖve even provided some clip art!</name>
<script>on mouseUpvisual scroll left to blackvisual scroll rightgo cd "ClipArt"end mouseUp</script>
</part>
<content>
<layer>card</layer>
<id>3</id>
<text>The button below will copy this XFCN into the stack you specify. This can be a Hypercard 1.2.5 or earlier stack if desired.</text>
</content>
<name></name>
<script></script>
</card>
card_3049.xml
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
<script>on mouseUp-- ask "How many samples?" with 10-- if it is empty then exit mouseUp-- if it is not a number then exit mouseUpanswer "Are you ready for 10 samples?" with "Cancel" or "Go"if it is "Cancel" then exit to Hypercardget 10lock screenset lockMessages to trueset lockRecent to trueput empty into card field "Stats"put empty into card field "Score"put 0 into theAverageput 0 into theScoreput 0 into trueScoreput 0 into falseScoreput 0 into leftScoreput 0 into rightScoreput 0 into hitAverageput 0 into missAverageput 0 into trueAverageput 0 into falseAverageput 0 into nocueAverageput 0 into leftAverageput 0 into rightAverageput card field "Accuracy" into theStepput it into theCountunlock screen with wipe downset cursor to nonerepeat with i = 1 to theCountget theTimer(theStep)-- build statisticsadd item 1 of it to theAverageif not (item 3 of it contains "InCorrect") thenadd 1 to theScoreadd item 1 of it to hitAverageelse add item 1 of it to missAverageif last item of it contains "true" thenadd 1 to trueScoreadd item 1 of it to trueAverageelse if last item of it contains "false" thenadd 1 to falseScoreadd item 1 of it to falseAverageelse add item 1 of it to nocueAverageif item 2 of it contains "left" thenadd 1 to leftScoreadd item 1 of it to leftAverageelse if item 2 of it contains "right" thenadd 1 to rightScoreadd item 1 of it to rightAverageend ifput i & "," & it & return after theStatsend repeatdivide theAverage by theCountif hitAverage > 0 then divide hitAverage by theScoreif missAverage > 0 then divide missAverage by (theCount-theScore)if trueAverage > 0 then divide trueAverage by trueScoreif falseAverage > 0 then divide falseAverage by falseScoreif nocueAverage > 0 then divide nocueAverage by (theCount-trueScore-falseScore)if leftAverage > 0 then divide leftAverage by leftScoreif rightAverage > 0 then divide rightAverage by rightScorelock screengo to cd "Start"put theStats into card field "Stats"set numberFormat to "0"put "Score" && theScore && "out of" && theCount into line 1 of card field "Score"set numberFormat to "0.0"put "Average" && theAverage into line 2 of card field "Score"put "Hit Average" && hitAverage into line 3 of card field "Score"put "Miss Average" && missAverage into line 4 of card field "Score"put "True Cue Average" && trueAverage into line 5 of card field "Score"put "False Cue Average" && falseAverage into line 6 of card field "Score"put "No Cue Average" && noCueAverage into line 7 of card field "Score"put "Left Average" && leftAverage into line 8 of card field "Score"put "Right Average" && rightAverage into line 9 of card field "Score"hide msgunlock screen with dissolve slowset lockMessages to falseset lockRecent to falseset cursor to browseend mouseUpfunction theTimer theStepvisual dissolve very fastgo to card "Waiting"-- choose the random cueput any item of "RightArrow,LeftArrow,noArrow" into theArrow-- theLetter is really a picture, but hey, it was a letter onceput any item of "RightLetter,LeftLetter" into theLetter-- save whether the arrow lied or notif ("Right" is in theArrow and "Right" is in theLetter) ¬or ("Left" is in theArrow and "Left" is in theLetter)then put "true" into goodArrowelse put "false" into goodArrow-- a random waitwait random(100) ticksvisual dissolve very fastgo to card theArrow-- YOU MUST LOCK THE SCREEN SO THE XFCN CAN UNLOCK ITlock screenwait random(50)+50 ticksgo to card theLetter-- doTimer unlocks the screen-- it returns the time in ms & the side-- add secret parameters to this call when you payput doTimer(theStep) into theTimeif item 1 of theTime is not a number then-- handle the Shareware error messagego to cd "Start"answer item 1 of theTimeexit to hypercardend if-- check for left or right arrow & build status messageif word 1 of item 2 of theTime is in theLetterthen put ",Correct" after theTimeelse put ",Incorrect" after theTimeput " with " after theTimeif theArrow is "noArrow"then put "no cue" after theTimeelse if goodArrowthen put "true cue" after theTimeelse put "false cue" after theTimereturn theTimeend theTimer</script>
</part>
<part>
<id>5</id>
<type>field</type>
<visible> <true /> </visible>
<dontWrap> <true /> </dontWrap>
<dontSearch> <false /> </dontSearch>
<sharedText> <false /> </sharedText>
<fixedLineHeight> <true /> </fixedLineHeight>
<autoTab> <false /> </autoTab>
<lockText> <true /> </lockText>
<rect>
<left>215</left>
<top>158</top>
<right>478</right>
<bottom>282</bottom>
</rect>
<style>shadow</style>
<autoSelect> <false /> </autoSelect>
<showLines> <false /> </showLines>
<wideMargins> <false /> </wideMargins>
<multipleLines> <false /> </multipleLines>
<reservedFamily> 0 </reservedFamily>
<titleWidth>0</titleWidth>
<icon>0</icon>
<textAlign>left</textAlign>
<font>Monaco</font>
<textSize>9</textSize>
<textStyle>plain</textStyle>
<textHeight>12</textHeight>
<name>Stats</name>
<script>on mouseUpsaveDataend mouseUp</script>
</part>
<part>
<id>6</id>
<type>field</type>
<visible> <true /> </visible>
<dontWrap> <true /> </dontWrap>
<dontSearch> <false /> </dontSearch>
<sharedText> <false /> </sharedText>
<fixedLineHeight> <true /> </fixedLineHeight>
<autoTab> <false /> </autoTab>
<lockText> <true /> </lockText>
<rect>
<left>33</left>
<top>169</top>
<right>206</right>
<bottom>282</bottom>
</rect>
<style>shadow</style>
<autoSelect> <false /> </autoSelect>
<showLines> <false /> </showLines>
<wideMargins> <false /> </wideMargins>
<multipleLines> <false /> </multipleLines>
<reservedFamily> 0 </reservedFamily>
<titleWidth>0</titleWidth>
<icon>0</icon>
<textAlign>center</textAlign>
<font>Monaco</font>
<textSize>9</textSize>
<textStyle>plain</textStyle>
<textHeight>12</textHeight>
<name>Score</name>
<script>on mouseUpsaveDataend mouseUp</script>
</part>
<part>
<id>7</id>
<type>button</type>
<visible> <true /> </visible>
<reserved5> 0 </reserved5>
<reserved4> 0 </reserved4>
<reserved3> 0 </reserved3>
<reserved2> 0 </reserved2>
<reserved1> 0 </reserved1>
<enabled> <true /> </enabled>
<rect>
<left>440</left>
<top>84</top>
<right>485</right>
<bottom>127</bottom>
</rect>
<style>transparent</style>
<showName> <false /> </showName>
<highlight> <false /> </highlight>
<autoHighlight> <true /> </autoHighlight>
<sharedHighlight> <true /> </sharedHighlight>
<family>0</family>
<titleWidth>0</titleWidth>
<icon>2478</icon>
<textAlign>center</textAlign>
<font>Chicago</font>
<textSize>12</textSize>
<textStyle>plain</textStyle>
<name></name>
<script>on mouseUpvisual dissolvego to card "Help"end mouseUp</script>
<text>1,240,Left Arrow,Correct with false cue2,240,Left Arrow,Correct with false cue3,240,Right Arrow,Correct with true cue4,285,Right Arrow,Correct with true cue5,285,Right Arrow,Correct with no cue6,330,Right Arrow,Correct with false cue7,270,Right Arrow,Correct with false cue8,225,Left Arrow,Correct with no cue9,285,Right Arrow,Correct with true cue10,240,Left Arrow,Correct with no cue</text>
</content>
<content>
<layer>card</layer>
<id>6</id>
<text>Score 10 out of 10Average 264.0Hit Average 264.0Miss Average 0.0True Cue Average 270.0False Cue Average 270.0No Cue Average 250.0Left Average 236.2Right Average 282.5</text>
</content>
<name>Start</name>
<script>on idleget the number of lines of card field "Stats" Γëñ 10put the style of card field "Stats" = "scrolling" into tiif it and tithen set style of card field "Stats" to shadowelse if not (ti or it)then set style of card field "Stats" to scrollingpass idleend idleon saveDataglobal testNumberanswer "Save these statistics?" with "No" or "Yes"if it is "Yes" thenif testNumber is empty then put 1 into testNumberput "Test" && testNumber && "of" && the short Date into theNameask file "Save as:" with theNameif it is empty then exit to hypercardopen file itwrite theName & return to file itwrite card field "Stats" to file itwrite return to file itwrite card field "Score" to file itclose file itadd 1 to testNumberend ifend saveDataon enterKeysend mouseUp to button "Start"end enterKey</script>
</card>
card_11720.xml
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
<text>When I was an undergrad at Western Washington University in lovely Bellingham, Washington from 79-83, I spent a lot of time in this out of the way computer room in the top of Miller Hall, which was, among other things, the Psyc building. I met some random psych people up there, and made some friends. Writing this XFCN caused me to remember some of them and their experiments. I hadn't thought of them in a while and just thought I would share it with you because I am sure that there have and will be people who have been there and done that. I know one who is still working there. (Hi Dave!) By the way, if you should ever be in Bellingham stop by the World War University's Miller Hall and enter on the right side as you approach from the fountain. Take the stairs as you enter and climb to the clouds (painted at the top). Out the door to the right and the computer room mentioned is on the left. Past it is the bathroom. Go there and read the grafitti. It is some of the best I have read. I think the best I ever saw had to be Dabny Hall at CalTech in 84-85 though. Grafitti was on every visible surface and there was an awesome rendition of the campus library from a divebomber.This XFCN is dedicated to the people who have worked in that Miller Hall computer room. If you were one, drop me a line at jpugh@apple.com</text>
</content>
<name></name>
<script>on mouseUpvisual barn door closego prevend mouseUp</script>
</card>
card_5594.xml
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
<text>This is a test of reaction times.When the graphic image appears press the left orright arrow key as fast as you can.Press the left arrow if the image is on the left side of the screenor the right arrow if the image is on the right.There is a random delay and a random cue arrow before the image appears.Early keystrokes are ignored.Any keys pressed except for the arrow keys are incorrect.</text>
</content>
<name>Help</name>
<script></script>
</card>
card_6010.xml
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >